#include <bits/stdc++.h>

using namespace std;
struct BigNum
{
    int d[1000];
    int len;
    BigNum()
    {
        memset(d,0,sizeof(d));
        len=0;
    }
};
int compare(BigNum a,BigNum b)
{
    if (a.len>b.len)
    {
        return 1;
    }
    else if (a.len<b.len)
    {
        return -1;
    }
    else
    {
        for (int i=a.len-1;i>=0 ;--i )
        {
            if (a.d[i]>b.d[i])
            {
                return 1;
            }else if(a.d[i]<b.d[i])
            {
                return -1;
            }
        }
        return 0;
    }
}
BigNum str2bign(char str[])
{
    BigNum bign;
    bign.len=strlen(str);
    for (int i=0;i<bign.len ; ++i)
    {
        bign.d[i]=str[bign.len-i-1]-'0';
    }
    return bign;
}
BigNum addBig(BigNum a,BigNum b)
{
    BigNum c;
    int carry=0,temp;
    for (int i=0;i<a.len||i<b.len ;++i )
    {
        temp=a.d[i]+b.d[i]+carry;
        c.d[c.len++]=temp%10;
        carry=temp/10;
    }
    if (carry!=0)
    {
        c.d[c.len++]=carry;
    }
    return c;
}
BigNum subBig(BigNum a,BigNum b)
{
    BigNum c;
    for (int i=0;i<a.len||i<b.len ;++i )
    {
        if (a.d[i]<b.d[i])
        {
            a.d[i]+=10;
            --a.d[i+1];
        }
        c.d[c.len++]=a.d[i]-b.d[i];
    }
    while (c.len>=2&&c.d[c.len-1]==0)
    {
        --c.len;
    }
    return c;
}
BigNum multi(BigNum a,int b)
{
    BigNum c;
    int carry=0,temp;
    for (int i=0;i<a.len ;++i )
    {
        temp=a.d[i]*b+carry;
        c.d[c.len++]=temp%10;
        carry=temp/10;
    }
    while (carry!=0)
    {
        c.d[c.len++]=carry%10;
        carry/=10;
    }
    return c;
}
BigNum divide(BigNum a,int b,int &r)
{
    BigNum c;
    c.len=a.len;
    for (int i=a.len-1;i>=0 ;--i )
    {
        r=r*10+a.d[i];
        if (r<b)
        {
            c.d[i]=0;
        }
        else
        {
            c.d[i]=r/b;
            r%=b;
        }
    }
    while (c.len>=2&&c.d[c.len-1]==0)
    {
        --c.len;
    }
    return c;
}
void print(BigNum a)
{
    for (int i=a.len-1;i>=0 ;--i )
    {
        printf("%d",a.d[i]);
    }
}
int main_121()
{
    char s1[1000]={0},s2[1000]={0};
    scanf("%s%s",s1,s2);//23461578905431628791032456821301232346157890543162879103245682130123
    BigNum a=str2bign(s1),b=str2bign(s2);
    print(addBig(a,b));
    printf("\n");
    if (compare(a,b)>0)
    {
        print(subBig(a,b));
    }
    else
    {
        printf("-");
        print(subBig(b,a));
    }
    printf("\n");
    print(multi(b,1024));
    printf("\n");
    int r=0;
    print(divide(b,1024,r));
    return 0;
}
